package cn.hn.java.summer.mvc;

import org.springframework.web.servlet.View;
import org.springframework.web.servlet.ViewResolver;

import java.util.Locale;

public class JxlsExcelViewResolver implements ViewResolver{

    //模板路径
    private String templatePath;

    public void setTemplatePath(String templatePath) {
        this.templatePath = templatePath;
    }

    public JxlsExcelViewResolver(String templatePath){
        this.templatePath=templatePath;
    }

    @Override
    public View resolveViewName(String viewName, Locale locale)
            throws Exception {
        JxlsExcelView view = new JxlsExcelView();
        view.setTemplatePath(this.templatePath);
        return view;
    }

}